import { Home } from '@/model/home/Home';
import { Socket } from '@/model/socket/Socket';
import { useInjectable } from '@/unit/hooks/use-di';
import { observer } from 'mobx-react-lite';
import { useCallback, useEffect } from 'react';
import Mine from './mine.view';

export default observer(() => {
  const home = useInjectable(Home);
  const socket = useInjectable(Socket);

  const send = useCallback(() => {
    socket.sendMessage('join', 'test2');
  }, [socket]);

  return <Mine state={home.activekey} handleClick={send} />;
});
